import torch

# 创建张量
tensor = torch.tensor([[1, 2], [3, 4]])

# 运算
result = torch.sum(tensor)
print("Sum:", result.item())